home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / NVRAMPlugin.p < prev    next >
Text File  |  1996-05-01  |  3KB  |  116 lines

  1. {
  2.      File:        NVRAMPlugin.p
  3.  
  4.      Version:    Technology:    
  5.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  6.  
  7.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16. {$IFC UNDEFINED UsingIncludes}
  17. {$SETC UsingIncludes := 0}
  18. {$ENDC}
  19.  
  20. {$IFC NOT UsingIncludes}
  21.  UNIT NVRAMPlugin;
  22.  INTERFACE
  23. {$ENDC}
  24.  
  25. {$IFC UNDEFINED __NVRAMPLUGIN__}
  26. {$SETC __NVRAMPLUGIN__ := 1}
  27.  
  28. {$I+}
  29. {$SETC NVRAMPluginIncludes := UsingIncludes}
  30. {$SETC UsingIncludes := 1}
  31.  
  32. {$IFC UNDEFINED __TYPES__}
  33. {$I Types.p}
  34. {$ENDC}
  35.  
  36. {$PUSH}
  37. {$ALIGN MAC68K}
  38. {$LibExport+}
  39.  
  40. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  41. {
  42. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  43.     status codes
  44. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  45. }
  46.  
  47. CONST
  48.     kNVRAMNoError                = 0;
  49.     kNVRAMTimeout                = 1;
  50.     kNVRAMUnexpectedError        = 2;
  51.     kNVRAMMemoryError            = 3;
  52.     kNVRAMParameterError        = 4;
  53.     kNVRAMDeviceError            = 5;
  54.     kNVRAMUnexpectedDeviceRequest = 6;
  55.     kNVRAMControllerError        = 7;
  56.     kNVRAMConsistencyCheckError    = 8;
  57.  
  58. {
  59. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  60.     Plugin Calls Provided by the Family
  61. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  62. }
  63. PROCEDURE NVRAMFamRequestComplete(theStatus: OSStatus); C;
  64. {
  65. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  66.     Plugin Calls Provided by the Plugin
  67. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  68.  all plugin calls are async
  69.  the plugin starts the i/o and returns immediately
  70.  the plugin ISR calls NVRAMFamRequestComplete() when the i/o is completed
  71. }
  72.  
  73. TYPE
  74.     NVRAMPluginInitPtr = ProcPtr;  { FUNCTION NVRAMPluginInitPtr: OSStatus; C; }
  75.  
  76.     NVRAMPluginReadPtr = ProcPtr;  { FUNCTION NVRAMPluginReadPtr(offset: UInt16; VAR data: UInt8; count: UInt16): OSStatus; C; }
  77.  
  78.     NVRAMPluginWritePtr = ProcPtr;  { FUNCTION NVRAMPluginWritePtr(offset: UInt16; VAR data: UInt8; count: UInt16): OSStatus; C; }
  79.  
  80.  
  81. CONST
  82.     kNVRAMPluginCurrentRevision    = $000D11E2;
  83.  
  84.  
  85. TYPE
  86.     NVRAMPluginVersionPtr = ^NVRAMPluginVersion;
  87.     NVRAMPluginVersion = RECORD
  88.         major:                    UInt32;
  89.         reserved0:                UInt32;
  90.         reserved1:                UInt32;
  91.         reserved2:                UInt32;
  92.     END;
  93.  
  94.     NVRAMPluginDispatchTablePtr = ^NVRAMPluginDispatchTable;
  95.     NVRAMPluginDispatchTable = RECORD
  96.         version:                NVRAMPluginVersion;
  97.         Init:                    NVRAMPluginInitPtr;
  98.         Read:                    NVRAMPluginReadPtr;
  99.         Write:                    NVRAMPluginWritePtr;
  100.     END;
  101.  
  102. FUNCTION NVRAMPluginInit: OSStatus; C;
  103. FUNCTION NVRAMPluginRead(offset: UInt16; VAR data: UInt8; count: UInt16): OSStatus; C;
  104. FUNCTION NVRAMPluginWrite(offset: UInt16; VAR data: UInt8; count: UInt16): OSStatus; C;
  105. {$ENDC}
  106. {$ALIGN RESET}
  107. {$POP}
  108.  
  109. {$SETC UsingIncludes := NVRAMPluginIncludes}
  110.  
  111. {$ENDC} {__NVRAMPLUGIN__}
  112.  
  113. {$IFC NOT UsingIncludes}
  114.  END.
  115. {$ENDC}
  116.